<?xml version="1.0" encoding="utf-8"?>
<html xmlns:str="http://exslt.org/strings"><head><title>duetopia - Documentation - OpenSearch</title><link rel="stylesheet" href="docs.css"/></head><body><div class="menu"><h3>Setup</h3><p><a href="installation.html">Installation</a><br/><a href="configuration.html">Configuration</a></p><h4>Customisation</h4><p><a href="custom_classes.html">Custom Classes</a></p><h3>Interfaces</h3><p><a href="api.html">Quick API Guide</a><br/><a href="opensearch.html">Opensearch Guide</a><br/><a href="opensearch_client.html">Opensearch Client</a></p></div><div id="header">
<h1>duetopia</h1>
</div><div id="content">
<h2>Configuration</h2>


<div id="cmenu">
<ul>
<li><a href="sample">Sample configuration</a></li>
<li><a href="run">Running the built-in server</a></li>
<li><a href="trouble">Troubleshooting</a></li>
<li><a href="test">Testing new installation</a></li>
</ul>
</div>
<a name="sample"/>
<p>The <code>config</code> subdirectory contains configuration for the registry app. Copy the whole thing to a working directory.

<blockquote><code>config/app/</code></blockquote>

<h4>settings.py</h4>
In here you'll find sample configuration for a Django application. <b>Edit this file:</b>

<blockquote><code>config/app/settings.py</code></blockquote> 

Here you'll need to change
<ul>
<li>The database hostname and port (if not on the same host as the main app)</li>
<li>The database username and password</li>
</ul>
Django looks in your environment to find out where it should be reading its settings from. Set the following environment variable for yourself or for your webserver:

<blockquote><code>~/config$ export DJANGO_SETTINGS_MODULE=app.settings</code></blockquote>

Note that the config package does not need to be called 'app', you can rename it to anything more fitting to your installation.

<a name="run"/>
<h4>runserver</h4>

Test your configuration by running the simple development webserver that comes with Django - invoke it like this: 

<blockquote><code>~/config$ python manage.py runserver</code></blockquote>

If all is well you will see a message similar to this one:
<pre>
Validating models...
0 errors found

Django version 1.0-alpha-SVN-unknown, using settings 'esa.settings'
Development server is running at http://127.0.0.1:8000/
Quit the server with CONTROL-C.
</pre> 

</p>
<a name="trouble"/>
<h4>Troubleshooting</h4>

<p>
If you see errors at this stage:

<ul>
<li>Check that the database username and password are correct in settings.py</li>
<li>Check that the database user has correct permissions (see <a href="installation.html#postgis">notes on PostGIS installation</a> for reference)</li>
<li>Make sure that you have the database tables installed correctly - run <code>syncdb</code> and loaded the redland tables - see <a href="installation.html#">installation</a>)</li>
<li>Make sure that the webserver can see the duetopia python modules - if duetopia is not installed in place where python will see it systemwide, PYTHONPATH should be set to the output of <code>duetopia-devel -p</code></li>
</ul>
</p>
<a name="test"/>
<h4>Testing</h4>
<p>
Test your installation by requesting an OpenSearch description for datasets:

<blockquote><code>http://127.0.0.1:8000/duetopia/register/dataset/description/</code></blockquote>

Once you are happy with the configuration you can look at installing duetopia for a <a href="installation.html#webserver">more permanent webserver</a>.

</p>

</div><div id="footer"><p><a href="introduction.html">Introduction / Index</a> | <a href="http://duetopia.googlecode.com/">Code Repository</a></p><p><a href="http://www.terradue.com/duetopia/"><img src="img/terradue_logo.jpg" border="0"/></a></p></div></body></html>
